Simple General Recursion in Type Theory
نویسنده
چکیده
General recursive algorithms are such that the recursive calls are performed on arguments satisfying no condition that guarantees termination. Hence, there is no direct way of formalising them in type theory. The standard way of handling general recursion in type theory uses a well-founded recursion principle. Unfortunately, this way of formalising general recursive algorithms often produces unnecessarily long and complicated codes. On the other hand, functional programming languages like Haskell impose no restrictions on recursive programs, and then writing general recursive algorithms is straightforward. In addition, functional programs are usually short and self-explanatory. However, the existing frameworks for reasoning about the correctness of Haskell-like programs are weaker than the framework provided by type theory. The goal of this work is to present a method that combines the advantages of both programming styles when writing simple general recursive algorithms. The method introduced here separates the computational and logical parts of the deenition of an algorithm, which has several advantages. First, the resulting type-theoretic algorithms are compact and easy to understand; they are as simple as their Haskell versions. Second, totality is now a separate task and hence, this method can also be used in the formalisation of partial functions. Third, the method presented here also simpliies the task of formal veriication. Finally, it can easily be extended to treat nested and mutual recursion. The main feature of the method is the introduction of an inductive predicate, specially deened for the algorithm to be formalised. This predicate can be thought of as characterising the set of inputs for which the algorithm terminates. It contains an introduction rule for each of the cases that need to be considered and provides an easy syntactic condition that guarantees the termination of the algorithm.
منابع مشابه
Modelling general recursion in type theory
Constructive type theory is a very expressive programming language. However, general recursive algorithms have no direct formalisation in type theory since they contain recursive calls that do not satisfy any syntactic condition that guarantees termination. We present a method to formalise general recursive algorithms in type theory that uses an inductive predicate to characterise termination a...
متن کاملNested General Recursion and Partiality in Type Theory
We extend Bove’s technique for formalising simple general recursive algorithms in constructive type theory to nested recursive algorithms. The method consists in defining an inductive special-purpose accessibility predicate, that characterizes the inputs on which the algorithm terminates. As a result, the type-theoretic version of the algorithm can be defined by structural recursion on the proo...
متن کاملProgrmaYerification in a l~gical Theory of Constructions
The logical theory of constructions is a simple theory which combines functional programs and intuitionistic predicate calculus. Here we propose that it is a practical alternative to other constructive programming logics, such as Martin-LSf's type theory. Its main advantage is that it admits reasoning directly about general recursion, while maintaining that all typed programs terminate. We illu...
متن کاملA Simple Proof of Mirzakhani’s Recursion Formula of Weil-petersson Volumes
In this paper, we give a simple proof of Mirzakhani's recursion formula of Weil-Petersson volumes of moduli spaces of curves using the Witten-Kontsevich theorem. We also briefly describe a very general recursive phenomenon in the intersection theory of moduli spaces of curves. In particular, we present several new recursion formulas for higher degree κ classes.
متن کاملFrequency Estimation of Unbalanced Three-Phase Power System using a New LMS Algorithm
This paper presents a simple and easy implementable Least Mean Square (LMS) type approach for frequency estimation of three phase power system in an unbalanced condition. The proposed LMS type algorithm is based on a second order recursion for the complex voltage derived from Clarke's transformation which is proved in the paper. The proposed algorithm is real adaptive filter with real parameter...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Nord. J. Comput.
دوره 8 شماره
صفحات -
تاریخ انتشار 2001